<!-- Galler -->
<?php if(isset($all_banner['home']) && !empty($all_banner['home'])):?>
<div class="wrapper clear">
	<div class="stretched">
		<div class="rslides_container clear">
			<ul class="rslides clear" id="rslides">
				<?php foreach ($all_banner['home'] as $banner):?>
				<li>
					<a target="_blank" href="<?php echo $banner['ban_link'];?>">
						<?php echo $this->Html->image('/admin/picture_banners/' . $banner['ban_picture'], array('alt' => $banner['ban_name'], 'fullBase' => false));?>
					</a>
				</li>
				<?php endforeach;?>
			</ul>
		</div>
	</div>
</div>
<?php endif;?>
<!-- content -->
<?php
if($home_category):
	foreach ($home_category as $cat):
		if (isset($cat['top_news']) && !empty($cat['top_news'])):
		$link_detail = $this->Html->url(
				array(
					'controller' => 'news',
					'action' => 'detail',
					'full_base' => true,
					'news_rewrite' => $cat['top_news']['new_rewrite'],
					'cat_rewrite' => $cat['categories_multi']['cat_rewrite'],
					'ext' => 'html',
				)
		);
		//link category
		$link_cat = $this->Html->url(
				array(
					'controller' => 'categorys',
					'action' => 'index',
					'cat_rewrite' => $cat['categories_multi']['cat_rewrite'],
				)
		);
?>
<div class="group-box">
	<div class="box-head"><a href="<?php echo $link_cat;?>"><?php echo $cat['categories_multi']['cat_name']?></a></div>
	<div class="box-body clearfix">
		<div class="cat-news clearfix">
			<a title="<?php echo $cat['top_news']['name']?>" href="<?php echo $link_detail;?>"><img align="left" title="<?php echo $cat['top_news']['name']?>" alt="<?php echo $cat['top_news']['name']?>" src="/admin/uploads/small_<?php echo $cat['top_news']['new_picture']?>"></a>
			<h4><a title="<?php echo $cat['top_news']['name']?>" href="<?php echo $link_detail;?>"><?php echo $cat['top_news']['name']?></a> </h4>
			<div class="clearfix"><?php echo $cat['top_news']['brief']?></div>
			<div class="news-more"><a href="<?php echo $link_detail;?>">Xem tiếp</a></div>
		</div>
		<?php if(isset($cat['news_category']) && !empty($cat['news_category'])):?>
		<div class="cat-morenews clearfix last">
			<ul>
				<?php
				foreach ($cat['news_category'] as $news):
					$link_detail = $this->Html->url(
							array(
								'controller' => 'news',
								'action' => 'detail',
								'full_base' => true,
								'news_rewrite' => $news['news']['new_rewrite'],
								'ext' => 'html',
							)
					);
				?>
				<li><a title="<?php echo $news['news']['name'];?>" href="<?php echo $link_detail;?>"><?php echo $news['news']['name'];?></a> </li>
				<?php endforeach;?>
			</ul>
		</div>
		<?php endif;//end if isset($cat['news_category']?>
	</div>
</div>
<?php
		endif;//end if isset($cat['top_news']
	endforeach;//end foreach $home_category
endif;//end if($home_category)
?>